# Maintainer: Caleb Maclennan <caleb@alerque.com>

pkgname=python-inflate64
_pyname=${pkgname#python-}
pkgver=0.3.1
pkgrel=2
pkgdesc='decompression of deflate64, enhanced deflate and compression algorithm'
arch=(loong64 x86_64)
url="https://codeberg.org/miurahr/${_pyname}"
license=(LGPL)
depends=(python)
makedepends=(python-{build,installer,wheel}
             python-setuptools-scm)
checkdepends=(python-pytest)
_archive="$_pyname-$pkgver"
source=("https://files.pythonhosted.org/packages/source/${_pyname::1}/$_pyname/$_archive.tar.gz")
sha256sums=('b52dd8fefd2ba179e5dfa18d6eca7e2fc822584616271c039d5ef1f9ca90c71c')

build(){
	cd "$_archive"
	python -m build -wn
}

check() {
	cd "$_archive"
	local _pyver=cpython-$(python -c 'import sys; print("".join(map(str, sys.version_info[:2])))')
	export PYTHONPATH="$PWD/build/lib.linux-$CARCH-$_pyver"
	python -m pytest tests
}

package() {
	cd "$_archive"
	python -m installer -d "$pkgdir" dist/*.whl
}
